package com.adopapa.ethexplorer.conf;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cache.annotation.CachingConfigurerSupport;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;


@Configuration
@EnableCaching
public class RedisConfig extends CachingConfigurerSupport {
	
	@Value("${redis.host}")
	private String host;
	@Value("${redis.port}")
	private int port;

	@Order(10001)
	@Bean
	public RedisTemplateManager<String, Object> redisTemplateManager() {
		RedisTemplateManager<String, Object> redisTemplateManager = //
				new RedisTemplateManager<String, Object>(host, port);
		return redisTemplateManager;
	}


}